{extend name="admin@index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">积分明细</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
    </div>
</div>
<script type="text/html" id="barTool">
    {{# if(d.status==0){ }}
    <a class="layui-btn layui-btn-xs" data-open='{:url("edit")}?id={{ d.id }}' data-title="审核">审核</a>
    {{# } }}

    {{# if(d.status==1&&d.is_kuan==0){ }}
    <a href="javascript:;" onclick="wk.confirm('{{d.id}}','{:url('ckuan')}','确认转账吗？')"
       class="layui-btn layui-btn-xs layui-btn-normal" title="确认转账">确认转账</a>
    {{# } }}


    {{# if(d.status==1){ }}
    <a class="layui-btn layui-btn-xs layui-btn-warm" data-open='{:url("detail")}?id={{ d.id }}'
       data-title="查看详情">查看详情</a>
    {{# } }}
</script>
{/block}
{block name="script"}
<script>
    layui.use(['yznTable', 'table'], function () {
        var table = layui.yznTable;
        var init = {
            table_elem: '#currentTable',
            table_render_id: 'currentTable',
            add_url: "{:url('add')}",
            edit_url: "{:url('edit')}",
            delete_url: "{:url('del')}",
        };
        table.render({
            elem: '#currentTable',
            autoWidth: true,
            search: false,
            toolbar: ['refresh',],
            url: '{:url("jf_list")}?order_id={$order_id}',
            init: init,
            cols: [
                [
                    // {type: 'checkbox', fixed: 'left'},
                    {field: 'id', align: 'center', width: '10%', title: 'ID'},
                    {field: 'points', align: 'center', width: '20%', title: '数量', search: false},
                    {field: 'date', align: 'center', width: '30%', title: '日期',},
                    // 1助力返积分 2订单使用 3提现 4订单退回 5会员订单奖励
                    {
                        field: 'is_get', width: '15%', align: "center", title: '领取状态', templet: function (d) {
                            if (d.is_get == 0) {
                                return '<span style="color: #cf9236">未领取</span>';
                            } else if (d.is_get == 1) {
                                return '<span style="color: #0000FF">已领取</span>';
                            } else if (d.is_get == 2) {
                                return '<span style="color: #00B83F">已过期</span>';
                            } else {
                                return '<span style="color: red">未领取</span>';
                            }
                        }, search: false
                    },


                    {field: 'get_time', align: 'center', width: '25%', title: '领取时间', search: 'range'},

                ]
            ],
            page: {}
        });
        table.bindevent();
        selectElement2 = document.getElementById('searchFieldset_currentTable');
        selectElement2.classList.remove("layui-hide");
        var element = document.getElementById('layui-input-search');
        element.parentNode.removeChild(element);
    });
</script>
{/block}